#!/bin/sh

while true
do
logfile=/data/feichangmoulue/jobs.log

ls_ymd=`date +%Y-%m-%d `
ls_date=`date +%H:%M:%S`

ls_data="$ls_date"
echo $ls_date

echo $ls_ymd  >> $logfile
echo $ls_date >> $logfile

#每天结束交易时 判断判断亏损额是否大于递延条件  接口：noDelay
if [ $ls_data \> "15:01:00" ] && [ $ls_data \< "15:01:05" ] ; then  
echo "www.fcml888.com/admin.php/admin/jobs/noDelay   " >> $logfile
curl  www.fcml888.com/admin.php/admin/jobs/noDelay
sleep 3;
fi

#每天凌晨扣除递延费 接口：delayDays
if [ $ls_data \> "00:30:00" ] && [ $ls_data \< "00:30:05" ] ; then  
echo "www.fcml888.com/admin.php/admin/jobs/delayDays  " >> $logfile
curl  www.fcml888.com/admin.php/admin/jobs/delayDays
sleep 3;
fi

#每天凌晨清数据库 接口：clearstock
if [ $ls_data \> "00:30:00" ] && [ $ls_data \< "00:30:05" ] || [ $ls_data \> "12:30:00" ] && [ $ls_data \< "12:30:05" ] ; then
#echo "www.fcml888.com/admin.php/admin/jobs/clearstock  " >> $logfile
#curl  www.fcml888.com/admin.php/admin/jobs/clearstock
sleep 3;
fi

#星期几
weekday=`date +%w`
#每个工作日的交易时间    比较止损线、止盈线 自动平仓 接口：pingCang
if [ $ls_data \> "09:30:00" ] && [ $ls_data \< "11:30:00" ] || [ $ls_data \> "13:00:00" ] && [ $ls_data \< "15:00:00" ] ; then  
echo "www.fcml888.com/admin.php/admin/jobs/pingCang   " >> $logfile
curl  www.fcml888.com/admin.php/admin/jobs/pingCang


echo "www.fcml888.com/admin.php/admin/jobs/getStockDataToDb   " >> $logfile
curl  www.fcml888.com/admin.php/admin/jobs/getStockDataToDb

fi


sleep 1

done





